<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>vue-router起步</title>
</head>
<style>
  *{
    list-style: none;
    margin: 0;
    padding: 0;
  }
</style>
<body>
  <div id="app">
    <h1>Hello App1!</h1>
    <p>
      <router-link to='/too'> Go to Foo </router-link>
      <router-link to='/bar'> Go to Bar </router-link>
    </p>
  </div>
  <!-- 路由出口 -->
  <!-- 路由匹配到的组件将被渲染到这里 -->
  <router-view></router-view>
</body>
<script src="./vue1111.js"></script>
<script src="./vue-router.js"></script>
<script>
  const Foo = { tempalte:'<div> foo </div>'};
  const Bar = { tempalte:'<div> bar </div>'};
  
  const routes =[
    {path:'./foo', component: Foo },
    {path:'./bar', component: Bar },
  ];
  const router = new VueRouter({
    routes:routes
  });
  const app = new Vue({
    router
  }).$mount('#app')
</script>
</html>